package com.ruoyi.web.controller.api.gold;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.data.domain.DataGold;
import com.ruoyi.data.service.IDataGoldService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author zzp
 * @version 1.0.0
 * @ClassName IndexController.java
 * @Description 积分接口
 * @createTime 2022年10月09日 16:05:00
 */
@Api("获取金豆信息接口")
@RestController
@RequestMapping("/api/gold")
public class GoldController extends BaseController {

    @Autowired
    private IDataGoldService goldService;

    @ApiOperation("获取金豆记录")
    @GetMapping("/goldList")
    public TableDataInfo goldList(DataGold gold) {
        startPage();
        List<DataGold> list = goldService.selectDataGoldListByUserId(getUserId(), gold.getGoldType());
        return getDataTable(list);
    }
}
